package com.castlesix.helloandroid;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;

public class HelloAndroid extends Activity {
	
	private static final String TAG = "HelloAndroidActivity";
	
	/** activity가 생성될 때 불려진다.
     * 보통 activity의 초기화 
     * */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button button =  (Button) findViewById(R.id.Button01);
        button.setOnClickListener(new View.OnClickListener() {			
			public void onClick(View v) {
				Intent intent = new Intent(getApplicationContext(), LaunchedActivity.class);
				startActivity(intent);
			}
		});
        
    }
    
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
    	Log.i(TAG, "onKeyDown: " + keyCode + ", " + event.toString());
    	return super.onKeyDown(keyCode, event);
    }
    
    @Override
    public boolean onKeyUp(int keyCode, KeyEvent event) {
    	Log.i(TAG, "onKeyUp: "+ keyCode + ", " + event.toString());
    	return super.onKeyUp(keyCode, event);
    }
    
    @Override
    public boolean onTouchEvent(MotionEvent event) {
    	Log.i(TAG, "onTouchEvent: " + event.toString());
    	return super.onTouchEvent(event);
    }
    
    @Override
    public boolean onTrackballEvent(MotionEvent event) {
    	Log.i(TAG, "onTrackballEvent: " + event.toString());
    	return super.onTrackballEvent(event);
    }
}